package cn.wizzer.app.crown.modules.models;

import cn.wizzer.app.crown.modules.models.enums.SettleStatusEnum;
import cn.wizzer.app.crown.modules.models.enums.PlayWayEnum;
import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.integration.json4excel.annotation.J4EIgnore;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Table("crown_order_detail")
@Data
@TableIndexes({@Index(name = "index_orderId", fields = {"orderId"}, unique = false)})
public class CrownOrderDetail extends BaseModel implements Serializable {
    @Column
    @Name
    @Comment("ID")
    @J4EIgnore
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(uu32 = true)
    private String id;

    @Column("order_id")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String orderId;

    @Column("game_id")
    @Comment("赛事或联赛(冠军)ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String gameId;

    //region 玩法
    @Column("no1")
    @ColDefine(type = ColType.INT, width = 2)
    private int no1;

    @Column("no2")
    @ColDefine(type = ColType.INT, width = 2)
    private int no2;

    @Column("no3")
    @ColDefine(type = ColType.INT, width = 2)
    private int no3;

    /**
     * future browse running
     */
    @Column("date_type")
    @ColDefine(type = ColType.VARCHAR, width = 8)
    private String dateType;

    @Column("h_in")
    @Comment("注单时主队得分")
    @ColDefine(type = ColType.VARCHAR, width = 16)
    private String hIn;

    @Column("c_in")
    @Comment("注单时客队得分")
    @ColDefine(type = ColType.VARCHAR, width = 16)
    private String cIn;

    @Column("coe_word")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String coeWord;

    @Column("coe_num")
    @ColDefine(type = ColType.VARCHAR, width = 8)
    private String coeNum;

    @Column
    @Comment("费率")
    @ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
    private BigDecimal odds;
    //endregion

    /**
     * 订单详情状态
     * WAIT_CONFIRM——待确认
     * WAIT_SETTLE——待结算
     * CANCELLED——已取消
     * FULL_WIN——全赢
     * FULL_LOSE——全输
     * HALF_WIN——半赢
     * HALF_LOSE——半输
     * GO_WATER——走水
     */
    @Column("status")
    @Comment("状态->WAIT_CONFIRM:待确认,WAIT_SETTLE:待结算,CANCELLED:已取消,FULL_WIN:全赢,FULL_LOSE:全输,HALF_WIN:半赢,HALF_LOSE:半输,GO_WATER:走水")
    @ColDefine(type = ColType.VARCHAR, width = 12)
    private SettleStatusEnum status;

    /**
     * 强哥说冗余会好点
     */
    @Column("play_way")
    @Comment("玩法")
    @ColDefine(type = ColType.VARCHAR, width = 10)
    private PlayWayEnum playWay;

    /**
     * 组装的标题
     * 例：!!! important 赛事单场/联赛单场
     * 足球 | 球会友谊赛
     * 足球 | 英格兰超级联赛
     */
    private String title;

    /**
     * 例： 里德 VS 杜克拉布拉格
     * 2019/2020 -英超冠军
     */
    private String titleSub;

    /**
     * 根据 投注 simplex做的转换 将no1 no2 …… 翻译成人话
     */
    private String betContent;

    /**
     * 开赛时间
     * 例：开赛时间(北京)2020-2-11 19:30:00
     */
    private Date matchStartDate;

    /**
     * 赛事全场比分
     */
    private String matchScore;

    /**
     * 赛事半场比分
     */
    private String matchHalfScore;

    /**
     * 比赛状态
     */
    private String matchStage;

}
